package com.aletto.general_store.ui.activities;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.aletto.general_store.R;
import com.aletto.general_store.ui.adapters.ChainNodesAdapter;
import com.aletto.general_store.ui.popup.AddChainNodePopup;
import com.aletto.general_store.ui.popup.GoodsPopup;
import com.aletto.general_store.utils.XHelper;
import com.lxj.xpopup.XPopup;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView;

public class ChainNodesActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_chain_nodes);

        XHelper.initTitle(this, R.string.title_chain_nodes);

        // 添加节点
        ImageView addNodeImage = findViewById(R.id.add_node_image);
        addNodeImage.setOnClickListener(v ->
                new XPopup.Builder(v.getContext())
                        .asCustom(new AddChainNodePopup(v.getContext()))
                        .show()
        );

        RecyclerView recyclerView = findViewById(R.id.recycler_view);
        recyclerView.setAdapter(new ChainNodesAdapter());
    }

}
